//
//  ChongzhiOrTixianHistoryTableViewCell.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/16.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "ChongzhiOrTixianHistoryTableViewCell.h"
#import "ChongzhiOrTixianModel.h"
@implementation ChongzhiOrTixianHistoryTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//    self.chongzhiBalanceLabel.text = [NSString stringWithFormat:@"%.2f",[model.usersCost doubleValue]/100];
//    self.chongzhiTimeLabel.text = [self timeStampForMessageTime:[NSString stringWithFormat:@"%f",[model.insertTime doubleValue]/1000]];
}
- (void)setModel:(ChongzhiOrTixianModel *)model
{
    switch ([model.status intValue]) {
        case 0:
        {
            model.status = @"待审核";
        }
               break;
        case 1:
        {
            model.status = @"提现成功";
        }
               break;
        case 2:
        {
            model.status = @"审核未通过";
        }
            break;
        case 3:
        {
            model.status = @"正在审核";
        }
            break;
            
        default:
            break;
    }
    self.stateLabel.text = model.status;
    self.timeLabel.text = [self timeStampForMessageTime:[NSString stringWithFormat:@"%f",[model.insertTime doubleValue]/1000]];
    self.moneyLabel.text = [NSString stringWithFormat:@"%.2f",[model.money doubleValue]/100];
}
-(NSString *)timeStampForMessageTime:(NSString *)strTime
{
    //实例化一个NSDateFormatter对象
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    
    //设定时间格式,这里可以设置成自己需要的格式
    
    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
    
    //用[NSDate date]可以获取系统当前时间
    
    NSString *currentDateStr = [dateFormatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:[strTime doubleValue]]];
    return currentDateStr;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
